//
//  RTModule.m
//  Demo
//
//  Created by 张志恒 on 16/11/18.
//  Copyright © 2016年 Autohome. All rights reserved.
//

#import "RTModule.h"

@interface RTModule ()

@property (nonatomic, strong, readwrite) id<RTModuleProtocol> moduleClass;

@end

@implementation RTModule

- (instancetype)initWithDictionary:(NSDictionary *)dict
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dict];
        
        if (self.moduleClassName.length) {
            Class cls = NSClassFromString(self.moduleClassName);
            id instanceCls = [[cls alloc] init];
            if ([instanceCls conformsToProtocol:@protocol(RTModuleProtocol)]) {
                self.moduleClass = [[cls alloc] init];
            }
        }
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {}

@end
